#include "FileTest.h"

FileTest::FileTest() {
    printf("FileTest: Opening disk.\n"); fflush(stdout);
    disk1 = new Disk(FILE_SYSTEM, FreeList::DEFAULT_NUMBER_OF_BLOCKS,
                        Disk::DEFAULT_BLOCK_SIZE);

    printf("FileTest: Opening FreeList.\n"); fflush(stdout);
    mother = new FreeList(disk1, false);

    printf("FileTest: Opening Directory.\n"); fflush(stdout);
    dir = new Directory(mother, false);

    printf("FileTest: Initializing file class.\n"); fflush(stdout);
    File::InitClass(dir, mother);

    printf("FileTest: Done constructor.\n"); fflush(stdout);
}

FileTest::~FileTest() {
    dir->Close();
    delete dir;
    printf("SUCCESS: dir is now closed.\n");

    if (! mother->Close()) {
        printf("ERROR: Could not close BlockGroup\n");
    }
    delete mother;
}


